﻿using System.Web.UI;
using System.Web.UI.Adapters;

namespace ScottCateAjax2008.ServerControls
{
    public class LocalScriptManagerControlAdapter : ControlAdapter
    {
        protected override void OnLoad(System.EventArgs e)
        {
            ScriptManager sm = this.Control as ScriptManager;
            if (sm != null)
            {
                ScriptReference sr = new ScriptReference();
                sr.Name = "MicrosoftAjax.js";
                sr.ScriptMode = ScriptMode.Auto;
                sr.Path = "~/common/scripts/MSAjaxDebug/System.Web.Extensions/3.6.0.0/3.6.20830.0/MicrosoftAjax.js";
                sm.Scripts.Add( sr );
                sm.EnableScriptLocalization = false;
            }
            base.OnLoad(e);
        }

    }
}